package com.stroage.controller;


import com.stroage.service.impl.TStorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import spring.cloud.Utils.R;

/**
 * @author cyt
 * @create 2020-06-07 17:07
 */
@RequestMapping("/storage")
@RestController
public class testController {
    @Autowired
    TStorageService tStorageService;
    /**
     * 修改库存
     * @param productId
     * @param count
     * @return
     */
    @RequestMapping("/dec/{productId}/{count}")
    public R dec(@PathVariable("productId") Integer productId,
                 @PathVariable("count") Integer count) {
        tStorageService.dec(productId, count);
        return R.ok();
    }
}
